<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <p id="p"></p>
    <script>
        setInterval(function(){
            var oDate=new Date();
            var hour=oDate.getHours();
            var minute=oDate.getMinutes();
            var seconds=oDate.getSeconds();
            function transform(params){
                return params=params<10?"0"+params:params;
            }
            hour=transform(hour)
            minute=transform(minute)
            seconds=transform(seconds)
            var sum=hour+":"+minute+":"+seconds;
            var p=document.getElementById("p")
            p.innerHTML=sum;
        },1000)
    </script>
</body>
</html>